package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 投资方式
 * Created by zhangwanli on 2017/11/12.
 */
@Getter
@AllArgsConstructor
public enum InvestWayEnum {
    BATCH((byte) 1, "批量投资"),
    AUTO((byte) 2, "自动投资"),
    MANUAL_DIRECT((byte) 3, "手动免密投资"),
    MANUAL_GATEWAY((byte) 4, "手动网关投资");

    private Byte value;
    private String desc;

    public static InvestWayEnum enumOf(Byte value) {
        for (InvestWayEnum wayEnum : values()) {
            if (wayEnum.value.equals(value)) {
                return wayEnum;
            }
        }
        throw new NoSuchEnumValueException("InvestWayEnum:" + value);
    }

}
